package org.saasplatform.apps;

import java.util.ArrayList;
import java.util.List;

public class InMemoryLeadDB implements LeadDB {

	List<Lead> leads = new ArrayList<Lead>();
	
	public void store(Lead lead) {
		leads.add(lead);
	}

	public Lead load(int leadId) {
		Lead srcLead = new Lead(null, leadId, 0.0);
		int idx = leads.indexOf(srcLead);
		if(idx != -1){
			return leads.get(idx);
		} else
			return null;
	}

	public int getLeadsNum() {
		return leads.size();
	}

}
